# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-sphinx-autoapi
_pyname=sphinx-autoapi
pkgver=3.3.3
pkgrel=0
pkgdesc="Automatic API documentation for Sphinx"
url="https://sphinx-autoapi.readthedocs.io"
arch="noarch !x86" # build breaks on x86
license="MIT"
depends="python3 py3-astroid py3-jinja2 py3-sphinx py3-anyascii py3-yaml"
makedepends="py3-gpep517 py3-flit-core py3-wheel"
checkdepends="py3-mock py3-pytest py3-beautifulsoup4"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/readthedocs/sphinx-autoapi/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -m 'not network'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
c6de80ceb7b394627ca19dbd59e8f7361ff1d14b5ab401134d149131b69f6be05348189ae97dcc6daa6e99276a99072d62990a8594be653d449659b556d86655  sphinx-autoapi-3.3.3.tar.gz
"
